package com.lyf.viewapp.list;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.lyf.viewapp.R;
import com.lyf.viewapp.animations.AnimationsMainActivity;
import com.lyf.viewapp.cards.CardSliderActivity;
import com.lyf.viewapp.cards.SwipeCardsActivity;
import com.lyf.viewapp.cards.zlayout.ZLayoutManagerActivity;
import com.lyf.viewapp.chart.LineChartActivity;
import com.lyf.viewapp.chart.PieChartActivity;
import com.lyf.viewapp.dialog.DialogMainActivity;
import com.lyf.viewapp.list.animators.RecyclerviewAnimatorsActivity;
import com.lyf.viewapp.list.one.MultiSelectActivity;
import com.lyf.viewapp.list.stickydecoration.StickyDecorationActivity;
import com.lyf.viewapp.other.OtherMainActivity;
import com.lyf.viewapp.picture.PictureMainActivity;
import com.lyf.viewapp.util.EnterAdapter;
import com.lyf.viewapp.util.EnterBean;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ListMainActivity extends AppCompatActivity {

    @BindView(R.id.list_main_listView)
    ListView listView;
    private List<EnterBean> list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list_main);
        ButterKnife.bind(this);

        list = new ArrayList<>();
        initDate();

    }

    private void initDate() {
        list.add(new EnterBean("StickyDecoration", StickyDecorationActivity.class));
        list.add(new EnterBean("RecyclerviewAnimators", RecyclerviewAnimatorsActivity.class));

        EnterAdapter ada = new EnterAdapter(this, list);
        listView.setAdapter(ada);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent intent = new Intent(ListMainActivity.this, list.get(position).getActivity());
                startActivity(intent);
            }
        });
    }
}
